package com.popo.android;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.TextView;

import com.popo.android.activity.ParcelableDestActivity;
import com.popo.android.entity.AParcelableEnity;
import com.popo.android.entity.ASerializableEnity;

public class ParceableTestActivity extends Activity {
	
	
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		final AParcelableEnity a = new AParcelableEnity();
		// TODO Auto-generated method stub
		super.onCreate(savedInstanceState);
		setContentView(R.layout.main);
		Button b = (Button) findViewById(R.id.intentbtn);
		a.a="this is a ";
		a.i=3;
		final TextView tv = (TextView) findViewById(R.id.ed);
		
		b.setOnClickListener(new OnClickListener() {
			
			@Override
			public void onClick(View v) {
				// TODO Auto-generated method stub
				Intent i = new Intent(ParceableTestActivity.this,ParcelableDestActivity.class);
				a.a=tv.getText().toString();
				i.putExtra("a",a);
				ASerializableEnity as = new ASerializableEnity();
				as.i=6;
				as.a=a.a;
				i.putExtra("as", as);
				
				startActivity(i);
			}
		});
	}
}


